home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / mus / play / tracker_4_31.lzh / tracker / build_vibrato.c < prev    next >
C/C++ Source or Header  |  1995-02-21  |  372b  |  25 lines

  1. /* the small file that is used to generate an accurate vibrato table */
  2. #include <math.h>
  3. #include <stdio.h>
  4.  
  5. main()
  6.     {
  7.     int i;
  8.     int amplitude = 512;
  9.     int period = 64;
  10.     double th;
  11.     double pi;
  12.  
  13.     pi = 4.0 * atan(1.0);
  14.  
  15.     for (i = 0; i < period; i++) 
  16.         {
  17.         th = 2.0 * pi * i / (double)period;
  18.         printf("%d,", (int) (0.5 + sin(th) * (double)amplitude));
  19.         }
  20.     return 0;
  21.     }
  22.  
  23.  
  24.     
  25.